<template>
  <div class="New_header">
    <div class="right">
      <router-link :to="{ name: loginRouter }" exact tag="a">{{
        loginName
      }}</router-link>
      &nbsp;&nbsp;&nbsp;
      <span v-if="loginName == '控制台'" @click="out">退出</span>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isSelect: "",
      mobileSlide: false,
      loginRouter: "login",
      loginName: "登录",
      msg: "",
      xianshi1: false,
      Newheader: false,
      routeArr: [
        {
          title: "首页",
          routeName: "indexWeb",
          routeTo: "websiteHome",
          existence: false
        }
      ]
    };
  },

  watch: {},
  created() {
    if (this.$store.state._token) {
      this.loginRouter = "step1";
      this.loginName = "控制台";
    }
  },
  methods: {
    out() {
      this.login_name = "登录";
      this.loginRouter = "login";
      this.$store.commit("app_id", "");
      this.$store.commit("_token", "");
      this.$store.commit("group_id", "");
      this.$store.commit("root_id", "");
      this.$store.commit("qiniu", "");
      this.$store.commit("app_name", "");
      this.$store.commit("group_name", "");
      this.$store.commit("app_cover", "");
    }
  }
};
</script>

<style lang="scss" scoped>
.New_header {
  width: 100%;
  height: 82px;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  padding-right: 200px;
  box-sizing: border-box;
  .right {
    width: 120px;
    height: 82px;
    line-height: 82px;
    float: right;
    span: {
      cursor: pointer;
    }
  }
}
</style>
